import { findHomeCategory } from '@/api/home'

// 分类数据
export default {
  namespaced: true,
  state: () => {
    return {
      list: []
    }
  },
  // 修改
  mutations: {
    setList (state, list) {
      state.list = list
    }
  },
  // 异步
  actions: {
    async findList (store) {
      // 获取分类数据
      const { result } = await findHomeCategory()
      // 调用修改更新数据
      store.commit('setList', result)
    }
  }
}
